import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_fai_webview/flutter_fai_webview.dart';
import 'package:flutter_learn_vi/src/bean/bean_news.dart';
import 'package:flutter_learn_vi/src/bean/bean_user_account.dart';
import 'package:flutter_learn_vi/src/net/dio_utils.dart';
import 'package:flutter_learn_vi/src/page/common/common_loading_dialog.dart';
import 'package:flutter_learn_vi/src/utils/log_util.dart';
import 'package:flutter_learn_vi/src/utils/toast_utils.dart';
import 'package:fluwx/fluwx.dart';
import 'package:get/get.dart';

import '../../bean/bean_integral.dart';
import 'news_details_controller.dart';

///   混合页面加载
///   一般用于商品详情页面的添加
///   如这里的上半部分是 Flutter Widget 内容  下半部分是 WebView
class NewsDetailePage extends StatefulWidget {
  final int newsId;

  final int taskId;
  final Size screenSize;

  NewsDetailePage(
      {@required this.newsId, @required this.screenSize, this.taskId});

  @override
  MaxUrlHexRefreshState createState() => MaxUrlHexRefreshState();
}

class MaxUrlHexRefreshState extends State<NewsDetailePage>
    with SingleTickerProviderStateMixin {
  // 0.0 ~ 1.0 默认
  AnimationController _animationController;

  //分享栏控制
  Animation<RelativeRect> rectAnimation;

  //按钮控制
  Animation<double> iconAnimation;
  String htmlUrl = "https://zhuanlan.zhihu.com/p/301305187";

  //原生 发送给 Flutter 的消息
  String title = "资讯详情";

  Timer _addReadRecoderTimer;
  Timer _addTaskRecoderTimer;
  int _taskTimes = 0;
  int _readTimes = 0;
  int _taskId;

  NewsDetailsController _newsDetailsController;

  @override
  void initState() {
    super.initState();

    _newsDetailsController =
        Get.put(NewsDetailsController(), tag: widget.newsId.toString());
    getNewsDetails();

    _initFluwx();

    // 0.0 ~ 1.0 默认
    _animationController = new AnimationController(
        vsync: this, duration: Duration(milliseconds: 400));

    iconAnimation =
        new Tween<double>(begin: 0.0, end: 1.0).animate(_animationController);

    Future.delayed(Duration(milliseconds: 400), () {
      //获取下边黑线高度（下边距）
      final double bottomPadding = MediaQuery.of(context).padding.bottom;
      //获取状态栏高度（上边距）
      final double topPadding = MediaQuery.of(context).padding.top;
      LogUtils.e("获取下边黑线高度（下边距） $bottomPadding  topPadding $topPadding");
      rectAnimation = RelativeRectTween(
        begin: RelativeRect.fromLTRB(
            12,
            widget.screenSize.height - 140 - topPadding / 2 - bottomPadding,
            16,
            16 + bottomPadding),
        end: RelativeRect.fromLTRB(
            widget.screenSize.width - 16 - 40,
            widget.screenSize.height - 140 - topPadding / 2 - bottomPadding,
            30,
            16 + bottomPadding),
      ).animate(_animationController);
      setState(() {});
    });
  }

  _initFluwx() async {
    await registerWxApi(
        appId: "wx2d70640bf5968287",
        doOnAndroid: true,
        doOnIOS: true,
        universalLink: "https://wxkd.jinbangshichuang.com/");
    var result = await isWeChatInstalled;
    print("is installed $result");
  }

  @override
  void dispose() {
    _animationController.dispose();
    if (_addReadRecoderTimer != null && _addReadRecoderTimer.isActive) {
      _addReadRecoderTimer.cancel();
      _addReadRecoderTimer = null;
    }
    if (_addTaskRecoderTimer != null && _addTaskRecoderTimer.isActive) {
      _addTaskRecoderTimer.cancel();
      _addTaskRecoderTimer = null;
    }
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      floatingActionButton: FloatingActionButton(
        backgroundColor: Colors.white,
        child: AnimatedIcon(
          color: Colors.blue,
          icon: AnimatedIcons.close_menu,
          progress: iconAnimation,
        ),
        onPressed: () {
          if (_animationController.status == AnimationStatus.completed) {
            _animationController.reverse();
          } else if (_animationController.status == AnimationStatus.dismissed) {
            _animationController.forward();
          }
        },
      ),
      //标题
      appBar: buildAppBar(context),
      //页面主体
      body: buildNewsWidget(),
    );
  }

  buildNewsWidget() {
    if (_newsBean == null) {
      return Container(child: LoadingWidget());
    }
    return LayoutBuilder(
        builder: (BuildContext context, BoxConstraints constraints) {
      final Size biggest = constraints.biggest;
      return Stack(
        children: [
          Positioned.fill(
            child: FaiWebViewItemWidget(
              url: _newsBean.detailUrl,
              callback: callBack,
            ),
          ),
          rectAnimation == null
              ? Container()
              : PositionedTransition(
                  rect: rectAnimation,
                  child: PhysicalModel(
                    elevation: 22.0,
                    color: Colors.black,
                    shadowColor: Colors.black,
                    borderRadius: BorderRadius.all(Radius.circular(30)),
                    child: Container(
                      padding: EdgeInsets.only(
                          top: 6, bottom: 6, left: 16, right: 56),
                      height: 44,
                      decoration: BoxDecoration(
                          color: Colors.white,
                          borderRadius: BorderRadius.all(Radius.circular(30))),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          buildBottomItem(
                            "assets/images/2.0x/read_1.png",
                            33,
                            count: _newsBean.readCount,
                            onTap: () {
                              ToastUtils.showToast("加油哈 每日练习每日进步");
                            },
                          ),
                          buildBottomItem(
                            "assets/images/2.0x/parise_1.png",
                            26,
                            count: _newsBean.pariseCount,
                            onTap: () {
                              if (_newsBean.parise) {
                                ToastUtils.showToast("已点过赞了..");
                                return;
                              }
                              pariseFunction();
                              _newsBean.parise = true;
                              _newsBean.pariseCount++;
                              setState(() {});
                              ToastUtils.showToast("点赞成功..");
                            },
                          ),
                          buildBottomItem(
                            "assets/images/2.0x/collect_icon.png",
                            22,
                            count: _newsBean.collectCount,
                            onTap: () {
                              if (_newsBean.collect) {
                                ToastUtils.showToast("已收藏了..");
                                return;
                              }
                              collectFunction();
                              _newsBean.collect = true;
                              _newsBean.collectCount++;
                              setState(() {});
                              ToastUtils.showToast("收藏成功..");
                            },
                          ),
                          // buildBottomItem(
                          //     "assets/images/2.0x/wei_xin_1.png", 33,
                          //     onTap: () async {
                          //   var result = await isWeChatInstalled;
                          //   if (result != null && !result) {
                          //     ToastUtils.showToast("无法打开微信 请检查是否安装了微信");
                          //     return;
                          //   }
                          //
                          //   /// 分享到好友
                          //   var model = WeChatShareWebPageModel(
                          //     _newsBean.shareUrl,
                          //     title: _newsBean.title,
                          //     thumbnail:
                          //         WeChatImage.network(_newsBean.coverImgUrl),
                          //     scene: WeChatScene.SESSION,
                          //   );
                          //   LogUtils.e("wvyb");
                          //
                          //   shareToWeChat(model);
                          // }),
                          // buildBottomItem(
                          //   "assets/images/2.0x/wei_xin_2.png",
                          //   33,
                          //   onTap: () async {
                          //     var result = await isWeChatInstalled;
                          //     if (result != null && !result) {
                          //       ToastUtils.showToast("无法打开微信 请检查是否安装了微信");
                          //       return;
                          //     }
                          //
                          //     /// 分享到好友
                          //     var model = WeChatShareWebPageModel(
                          //       _newsBean.shareUrl,
                          //       title: _newsBean.title,
                          //       thumbnail:
                          //           WeChatImage.network(_newsBean.coverImgUrl),
                          //       scene: WeChatScene.TIMELINE,
                          //     );
                          //     shareToWeChat(model);
                          //   },
                          // ),
                        ],
                      ),
                    ),
                  ),
                ),
          Positioned(
            left: 10,
            top: 10,
            child: buildTimerTips(),
          ),
        ],
      );
    });
  }

  Expanded buildBottomItem(String image, double imageSize,
      {num count = 0, GestureTapCallback onTap}) {
    double messageWidget = 14.0;
    if (count > 9) {
      messageWidget = 24;
    } else if (count > 99) {
      messageWidget = 34;
    }
    return Expanded(
      child: InkWell(
        onTap: onTap,
        child: Padding(
          padding: EdgeInsets.only(
            left: 12,
            right: 12,
          ),
          child: Stack(
            alignment: Alignment.center,
            children: [
              Align(
                alignment: Alignment(-0.2, 0.2),
                child: Image.asset(
                  image,
                  height: imageSize,
                ),
              ),
              count == 0
                  ? Container()
                  : Container(
                      alignment: Alignment(0.2, -0.8),
                      margin: EdgeInsets.only(bottom: 10, left: 10),
                      child: ClipRRect(
                        borderRadius: BorderRadius.all(Radius.circular(8)),
                        child: Container(
                          alignment: Alignment.center,
                          width: messageWidget,
                          height: 14,
                          color: Colors.red.withAlpha(220),
                          child: Text(
                            "$count",
                            style: TextStyle(fontSize: 10, color: Colors.white),
                          ),
                        ),
                      ),
                    ),
            ],
          ),
        ),
      ),
    );
  }

  NewsBean _newsBean;
  IntegralStatBean _rankStatBean;
  TaskBean _taskBean;

  Future<bool> getNewsDetails() async {
    Map<String, dynamic> map = {
      "newsId": widget.newsId,
    };
    //获取内容详情
    ResponseInfo partResponseInfo = await DioUtils.instance.getRequest(
      url: HttpHelper.getNewsDetail,
      queryParameters: map,
    );
    if (partResponseInfo.success) {
      Map element = partResponseInfo.data;
      _newsBean = NewsBean.fromJson(element);
    }

    if (mounted) {
      setState(() {});
    }

    _taskId = widget.taskId;
    if (_taskId == null) {
      LogUtils.e("加载请求默认的任务配置 start ");
      ResponseInfo taskConfigResponse = await DioUtils.instance.getRequest(
        url: HttpHelper.taskNewsDefaultConfig,
      );
      if (taskConfigResponse.success) {
        LogUtils.e("加载请求默认的任务配置 success ");
        var responseData = taskConfigResponse.data;
        if (responseData != null) {
          TaskBean taskBean = TaskBean.fromMap(responseData);
          _taskId = taskBean.id;
          LogUtils.e("加载请求默认的任务配置 默认的配置  $_taskId");
        } else {
          LogUtils.e("加载请求默认的任务配置 无默认的配置 ");
        }
      } else {
        LogUtils.e("加载请求默认的任务配置 失败 ");
      }
    }

    if (_taskId != null) {
      //获取积分配置
      Map<String, dynamic> queryParameters = Map();
      //任务类型 0 阅读 ； 1 学习；2 看视频
      queryParameters["taskFlag"] = 0;
      queryParameters["taskId"] = _taskId;
      //校验积分
      ResponseInfo checkResponsseInfo = await DioUtils.instance.getRequest(
        url: HttpHelper.taskConfigCheck,
        queryParameters: queryParameters,
      );
      if (checkResponsseInfo.success) {
      } else {
        LogUtils.e("${checkResponsseInfo.message}");
        return false;
      }

      ResponseInfo taskConfigResponse = await DioUtils.instance.getRequest(
        url: HttpHelper.taskConfig,
        queryParameters: queryParameters,
      );
      if (taskConfigResponse.success && _newsBean != null) {
        var responseData = taskConfigResponse.data;
        if (responseData != null) {
          _taskBean = TaskBean.fromMap(responseData);
          //任务时间配置
          int taskTimes = _taskBean.readTimes;

          _addTaskRecoderTimer =
              Timer.periodic(Duration(seconds: 1), (Timer timer) {
            _taskTimes++;
            LogUtils.e("定时任务执行中 $_taskTimes");
            _newsDetailsController.update(["timsTips"]);
            if (_taskTimes >= taskTimes) {
              _addTaskRecoderTimer.cancel();
              _addTaskRecoderTimer = null;
              addTaskRecoder();
            }
          });

          if (_taskBean.examinConfig != null) {
            _rankStatBean = _taskBean.examinConfig;
            int readTimes = _rankStatBean.readTimes;
            _addReadRecoderTimer =
                Timer.periodic(Duration(seconds: 1), (Timer timer) {
              _readTimes++;
              _newsDetailsController.update(["timsTips"]);
              if (_readTimes >= readTimes) {
                _addReadRecoderTimer.cancel();
                _addReadRecoderTimer = null;
                addReadRecoder();
              }
            });
          }
        }
      }
    } else {
      //获取积分配置
      ResponseInfo statisRresponseInfo = await DioUtils.instance.getRequest(
        url: HttpHelper.integralStatisticsNews,
      );

      if (statisRresponseInfo.success) {
        var responseData = statisRresponseInfo.data;
        if (responseData != null) {
          _rankStatBean = IntegralStatBean.fromJson(responseData);
          int readTimes = _rankStatBean.readTimes;
          _addReadRecoderTimer =
              Timer.periodic(Duration(seconds: 1), (Timer timer) {
            _readTimes++;
            _newsDetailsController.update(["timsTips"]);
            if (_readTimes >= readTimes) {
              _addReadRecoderTimer.cancel();
              _addReadRecoderTimer = null;
              addReadRecoder();
            }
          });
          return Future.value(true);
        }
      }
    }

    return Future.value(true);
  }

  ///标题部分
  AppBar buildAppBar(BuildContext context) {
    return AppBar(
        centerTitle: true,
        leading: IconButton(
          onPressed: () {
            Navigator.pop(context);
          },
          icon: Icon(Icons.arrow_back_ios),
        ),
        title: Text(
          title,
        ));
  }

  double preDy = 0.0;
  double _opacity = 1.0;

  Widget buildTimerTips() {
    return GetBuilder(
      id: "timsTips",
      tag: widget.newsId.toString(),
      builder: (NewsDetailsController controller) {
        return Opacity(
          opacity: 0.1,
          child: Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              buildTaskTipsWidget(),
              SizedBox(
                height: 10,
              ),
              buildReadTipsWidget(),
            ],
          ),
        );
      },
    );
  }

  Widget buildTaskTipsWidget() {
    if (_taskBean == null) {
      return SizedBox();
    }
    int timeFlag = _taskBean.readTimes - _taskTimes;
    return ClipRRect(
      borderRadius: BorderRadius.all(Radius.circular(8)),
      child: Container(
        color: Colors.blue,
        padding: EdgeInsets.only(left: 4, right: 4, top: 2, bottom: 4),
        child: Row(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            SizedBox(
              width: 12,
              height: 12,
              child: CircularProgressIndicator(
                backgroundColor: Colors.grey,
                strokeWidth: 2,
                valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
                value: _taskTimes / _taskBean.readTimes,
              ),
            ),
            SizedBox(width: 4),
            Text(
              timeFlag > 0 ? "阅读$timeFlag秒达成任务" : "已完成",
              style: TextStyle(fontSize: 10, color: Colors.white),
            )
          ],
        ),
      ),
    );
  }

  Widget buildReadTipsWidget() {
    if (_rankStatBean == null) {
      return SizedBox();
    }
    int timeFlag = _rankStatBean.readTimes - _readTimes;
    return ClipRRect(
      borderRadius: BorderRadius.all(Radius.circular(8)),
      child: Container(
        color: Colors.deepOrange,
        padding: EdgeInsets.only(left: 4, right: 4, top: 2, bottom: 4),
        child: Row(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            SizedBox(
              width: 12,
              height: 12,
              child: CircularProgressIndicator(
                backgroundColor: Colors.grey,
                strokeWidth: 2,
                valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
                value: _readTimes / _rankStatBean.readTimes,
              ),
            ),
            SizedBox(width: 4),
            Text(
              timeFlag > 0 ? "阅读$timeFlag秒获取积分" : "已获取积分",
              style: TextStyle(fontSize: 10, color: Colors.white),
            )
          ],
        ),
      ),
    );
  }

  ///可滑动的 视图
  ///在 WebView 上方
  Widget buildHeaderWidget() {
    return Container();
  }

  Widget buildFooterWidget() {
    return AnimatedOpacity(
      opacity: _opacity,
      duration: Duration(milliseconds: 100),
      child: Container(
        decoration: BoxDecoration(color: Colors.white, boxShadow: [
          BoxShadow(color: Colors.grey, offset: Offset(0, -1), blurRadius: 1)
        ]),
        padding: EdgeInsets.only(top: 0),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Container(
              padding: EdgeInsets.all(12),
              height: Platform.isIOS ? 90 : 66,
              child: Stack(
                children: [
                  Positioned(
                    left: 0,
                    right: 0,
                    top: 0,
                    child: Text("${_newsBean.readCount} 阅读"),
                  ),
                  Positioned(
                    left: 0,
                    right: 0,
                    top: 0,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        GestureDetector(
                          onTap: () {
                            _newsBean.parise = !_newsBean.parise;
                            setState(() {});
                            pariseFunction();
                          },
                          child: Container(
                            height: 34,
                            width: 100,
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                                borderRadius:
                                    BorderRadius.all(Radius.circular(40)),
                                border: Border.all(
                                  color: _newsBean.parise
                                      ? Colors.deepOrangeAccent
                                      : Colors.grey,
                                )),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Image.asset(
                                  _newsBean.parise
                                      ? "assets/images/2.0x/no_parise_icon.png"
                                      : "assets/images/2.0x/use_parise_icon.png",
                                  width: 18,
                                  height: 18,
                                ),
                                SizedBox(
                                  width: 8,
                                ),
                                Text(
                                  _newsBean.parise ? "已赞" : "赞",
                                  style: TextStyle(
                                      color: _newsBean.parise
                                          ? Colors.deepOrangeAccent
                                          : Colors.grey),
                                )
                              ],
                            ),
                          ),
                        )
                      ],
                    ),
                  )
                ],
              ),
            )
          ],
        ),
      ),
    );
  }

  //如果你需要的话就使用
  Future<bool> _onRefresh() async {
    await getNewsDetails();
    ToastUtils.showToast("已刷新");
    return Future.value(true);
  }

  double middleHeight = 0.0;

  callBack(int code, String msg, content) {
    //加载页面完成后 对页面重新测量的回调
    if (code == 201) {
      double height = MediaQuery.of(context).size.height;
    }
    if (code == 303 || code == 302) {
      if (_animationController.status == AnimationStatus.dismissed) {
        _animationController.forward();
      }
    }
  }

  Future<bool> pariseFunction() async {
    Map<String, dynamic> map = {
      "newsId": widget.newsId,
      "flag": _newsBean.parise ? 0 : 1,
    };
    ResponseInfo partResponseInfo = await DioUtils.instance.getRequest(
      url: HttpHelper.addNewsPairse,
      queryParameters: map,
    );
    if (partResponseInfo.success) {
      LogUtils.e("点赞成功");
    } else {
      LogUtils.e("点赞失败");
    }

    return Future.value(true);
  }

  Future<bool> collectFunction() async {
    Map<String, dynamic> map = {
      "newsId": widget.newsId,
      "title": _newsBean.title,
      "flag": !_newsBean.collect ? 0 : 1,
      "collectType": "news"
    };
    ResponseInfo partResponseInfo = await DioUtils.instance.getRequest(
      url: HttpHelper.addNewsCollect,
      queryParameters: map,
    );
    if (partResponseInfo.success) {
      LogUtils.e("点赞成功");
    } else {
      LogUtils.e("点赞失败");
    }

    return Future.value(true);
  }

  ///添加任务记录
  Future<bool> addTaskRecoder() async {
    Map<String, dynamic> jsonMap = Map();
    jsonMap["taskId"] = _taskBean.id;
    jsonMap["itemId"] = _newsBean.id;
    // 0 阅读  ； 1视频 ；2 答题
    jsonMap["itemType"] = 0;
    jsonMap["itemName"] = _newsBean.title;

    ///添加任务记录
    ResponseInfo addTaskRecoderResonInfo = await DioUtils.instance.postRequest(
      url: HttpHelper.taskDetailsAdd,
      jsonMap: jsonMap,
    );
    if (addTaskRecoderResonInfo.success) {
      LogUtils.e("添加任务记录成功");
    } else {
      LogUtils.e("添加任务记录失败");
    }
    return true;
  }

  /// 添加阅读记录 用来配置积分
  Future<bool> addReadRecoder() async {
    Map<String, dynamic> map = {
      "newsId": widget.newsId,
      "taskId": _taskId,
      "configId": _rankStatBean.id,
      "taskType": 1,
    };
    if (_newsBean != null) {
      map["newsTitle"] = _newsBean.title;
    }
    ResponseInfo partResponseInfo = await DioUtils.instance.getRequest(
        url: HttpHelper.integralStatisticsNewsTaskAdd, queryParameters: map);
    if (partResponseInfo.success) {
      LogUtils.e("积分添加成功");
      ToastUtils.showToast("阅读已获得积分");
    } else {
      LogUtils.e("积分添加失败");
      ToastUtils.showToast("未获取积分：" + partResponseInfo.message);
    }

    return Future.value(true);
  }

  ///底部分享组件区域
  Widget buildShareWidget() {
    if (rectAnimation == null) {
      return Container();
    }

    return PositionedTransition(
      rect: rectAnimation,
      child: PhysicalModel(
        elevation: 22.0,
        color: Colors.black,
        shadowColor: Colors.black,
        borderRadius: BorderRadius.all(Radius.circular(30)),
        child: buildShareWidgetContainer(),
      ),
    );
  }

  Widget buildShareWidgetContainer() {
    return Container(
      padding: EdgeInsets.only(top: 6, bottom: 6, left: 16, right: 56),
      decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.all(Radius.circular(30))),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          buildBottomItem(
            "assets/images/2.0x/read_1.png",
            33,
            count: _newsBean.readCount,
            onTap: () {
              ToastUtils.showToast("加油哈 每日练习每日进步");
            },
          ),
          buildBottomItem(
            "assets/images/2.0x/parise_1.png",
            26,
            count: _newsBean.pariseCount,
            onTap: () {
              if (_newsBean.parise) {
                ToastUtils.showToast("已点过赞了..");
                return;
              }
              pariseFunction();
              _newsBean.parise = true;
              _newsBean.pariseCount++;
              setState(() {});
              ToastUtils.showToast("点赞成功..");
            },
          ),
          // buildBottomItem("assets/images/2.0x/wei_xin_1.png", 33,
          //     onTap: () async {
          //   var result = await isWeChatInstalled;
          //   if (result != null && !result) {
          //     ToastUtils.showToast("无法打开微信 请检查是否安装了微信");
          //     return;
          //   }

          /// 分享到好友
          //   var model = WeChatShareWebPageModel(
          //     _newsBean.shareUrl,
          //     title: _newsBean.title,
          //     thumbnail: WeChatImage.network(_newsBean.coverImgUrl),
          //     scene: WeChatScene.SESSION,
          //   );
          //   LogUtils.e("wvyb");
          //
          //   shareToWeChat(model);
          // }),
          // buildBottomItem(
          //   "assets/images/2.0x/wei_xin_2.png",
          //   33,
          //   onTap: () async {
          //     var result = await isWeChatInstalled;
          //     if (result != null && !result) {
          //       ToastUtils.showToast("无法打开微信 请检查是否安装了微信");
          //       return;
          //     }
          //
          //     /// 分享到好友
          //     var model = WeChatShareWebPageModel(
          //       _newsBean.shareUrl,
          //       title: _newsBean.title,
          //       thumbnail: WeChatImage.network(_newsBean.coverImgUrl),
          //       scene: WeChatScene.TIMELINE,
          //     );
          //     shareToWeChat(model);
          //   },
          // ),
        ],
      ),
    );
  }
}
